<?php
require_once(dirname(__FILE__) . '/app.php');

if(!$INI['db']['host']){
	redirect( WEB_ROOT . '/install.php' );
}

$campainList = array();
if( $defaultShopId < 1 ){
	$campainList = Campaign::GetAll();
}else{
	$campainList = Campaign::GetAllByShopId($defaultShopId);
}

if( $_GET['id'] > 0 ){
	$campain = Campaign::getById($_GET['id']);
	include template('campain');
	exit;
}


include template('campain_list');
